<!doctype html>
<html lang="en">
<head>
	<meta charset="ANSI" />
	<title>Aips</title>
	<link rel="stylesheet" href="styles.css" type="text/css" media="screen" />
	<link rel="stylesheet" type="text/css" href="print.css" media="print" />
		<style type="text/css" media="screen">
			h1.fontface {font: 32px/38px 'MichromaRegular', Arial, sans-serif;letter-spacing: 0;}
			p.style1 {font: 18px/27px 'MichromaRegular', Arial, sans-serif;}
					
			@font-face {
			    font-family: 'MichromaRegular';
			    src: url('Michroma-webfont.eot');
			    src: url('Michroma-webfont.eot?#iefix') format('embedded-opentype'),
			         url('Michroma-webfont.woff') format('woff'),
			         url('Michroma-webfont.ttf') format('truetype'),
			         url('Michroma-webfont.svg#MichromaRegular') format('svg');
			    font-weight: normal;
			    font-style: normal;}
		</style>
	<!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
	 <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>

      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>

      <script type="text/javascript">

          function loadXMLDoc(form) {
 var id;
			  var xmlhttp1 = new XMLHttpRequest();
              xmlhttp1.open("POST", "http://164.8.251.99:9793/services/cir2012/SiNf_aips?wsdl", false); 
              xmlhttp1.onreadystatechange = function () {
                  if (xmlhttp1.readyState == 4) {

                      var xmlString = xmlhttp1.responseText;
                      var parser = new DOMParser();
                      var xmlDoc = parser.parseFromString(xmlString, "application/xml");

                      id = xmlDoc.getElementsByTagName("id")[0].childNodes[0].nodeValue; 
                      var ime = xmlDoc.getElementsByTagName("ime")[0].childNodes[0].nodeValue;

       
                  }
              }

              xmlhttp1.setRequestHeader("SOAPAction", "getPredmetID"); 
              xmlhttp1.setRequestHeader("Content-Type", "text/xml");
              var xml = '<?xml version="1.0" encoding="utf-8"?>' +
                 '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
                                'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
                                'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
                   '<soap:Body> ' +
                     '<getPredmetID xmlns="http://services.mashup.wso2.org/SiNf_aips/"> ' +
                     '<imeAliIdPredmeta>' + form.idPredmetaDROP.value + '</imeAliIdPredmeta>' +
                     '</getPredmetID> ' +
                   '</soap:Body> ' +
                 '</soap:Envelope>';

              xmlhttp1.send(xml);
			  
			  
			  var xmlhttp = new XMLHttpRequest();
              xmlhttp.open("POST", "http://164.8.251.99:9793/services/cir2012/SiNf_aips?wsdl", false); 
              xmlhttp.onreadystatechange = function () {
                  if (xmlhttp.readyState == 4) {

                      var xmlString = xmlhttp.responseText;

                      var parser = new DOMParser();
                      var xmlDoc = parser.parseFromString(xmlString, "application/xml");
					  
					  var prestej = xmlDoc.getElementsByTagName("izpitniRok"); 
 
                      for (var i = 0; i < prestej.length; i++) {
         
                      var predmet = xmlDoc.getElementsByTagName("predmet")[i].childNodes[0].nodeValue; 
                      var zavod = xmlDoc.getElementsByTagName("zavod")[i].childNodes[0].nodeValue;
                      var tip = xmlDoc.getElementsByTagName("tip")[i].childNodes[0].nodeValue;
                      var komisijski = xmlDoc.getElementsByTagName("komisijski")[i].childNodes[0].nodeValue;
					  var prostor = xmlDoc.getElementsByTagName("prostor")[i].childNodes[0].nodeValue;
                      var datum = xmlDoc.getElementsByTagName("datum")[i].childNodes[0].nodeValue;
                      var ura = xmlDoc.getElementsByTagName("ura")[i].childNodes[0].nodeValue;

                      var izpisDanes = "<center>Zavod: " + zavod + "</center>";
                      izpisDanes += "<center>Predavalnica: " + prostor + "</center>";
                      izpisDanes += "<center>Tip: " + tip + "</center>";
                      izpisDanes += "<center>Komisijski: " + komisijski + "</center>";
                      izpisDanes += "<center>Datum izpita: " + datum + "</center>";
					  izpisDanes += "<center>Ura izpita: " + ura + "</center></br></br>";

                      document.getElementById("idPredmeta").innerHTML = "<h1><center>Izpitni roki za predmet: " + predmet + "</center></h1>";
                      document.getElementById("trenutno").innerHTML += izpisDanes;
                      
					  }
                  }
              }

              xmlhttp.setRequestHeader("SOAPAction", "getIzpitniRokiPoPredmetu"); 
              xmlhttp.setRequestHeader("Content-Type", "text/xml");
              var xml = '<?xml version="1.0" encoding="utf-8"?>' +
                 '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
                                'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
                                'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
                   '<soap:Body> ' +
                     '<getIzpitniRokiPoPredmetu xmlns="http://services.mashup.wso2.org/SiNf_aips/"> ' +
                     '<predmetID>' + id + '</predmetID>' +
                     '</getIzpitniRokiPoPredmetu> ' +
                   '</soap:Body> ' +
                 '</soap:Envelope>';

              xmlhttp.send(xml);
			  
          }
          document.addEventListener("deviceready", loadXMLDoc, false);
        </script>
	
</head>
	<body>
		<header>
			<div class="container1">
			    <!--start title-->
			    <h1 class="fontface" id="title">SKUPINA HTML5</h1>
				<!--end title-->
			</div>
		</header>
		<!--end header-->
		
	<nav>
		<div class="menu">
		    <ul>
		    <li><a href="index.html">Domov</a></li>
		    <li><a href="vreme.html">Vreme</a></li>
		    <li><a href="oglasna.html">Oglasna deska FERI</a></li>
		    <li><a href="forum.html">Forum FERI</a></li>
		    <li><a href="aips.html">Aips</a></li>
			<li><a href="novice_um.html">Novice UM</a></li>
			<li><a href="stuk.html">Stuk</a></li>
			<li><a href="soum.html">SOUM</a></li>
			<li><a href="zagovori.html">Zagovori diplom</a></li>
		    </ul>
		</div>
    </nav>
	
	<div id="wrapper"><!-- #wrapper -->
		<section id="main"><!-- #main content and sidebar area -->
			<aside id="sidebar1"><!-- sidebar1 -->
				<br><br><br>	
						<h3>Povezave </h3><br>
					<ul>
						<li><a href="http://www.feri.uni-mb.si/podrocje.aspx">FERI</a></li>
						<li><a href="http://moodle.informatika.uni-mb.si/login/index.php">Moodle</a></li>			
					</ul>
			</aside><!-- end of sidebar1 -->
       
			<section id="content"><!-- #content -->
				<div class="newsbox" >		 		
					<h2>Izpitni roki</h2>
				</div>
				<div class="newsbox">
					<center><form action="">

						Vnesi naziv ali id predmeta<br/>
						<input id="kraj" type="text" name="idPredmetaDROP"/><br />
						<input type="button" onclick="loadXMLDoc(this.form)" value="Poglej" />
					</form></center>
					
					<div id="idPredmeta"></div>
					<div id="trenutno"></div>
								
				</div>					
			</section><br><br><br><br><br><br><br><br><br><br>
			<br>
	</div>
</body>
</html>
